<?php
namespace App;

use App\Animal\Animal;

class Zoo
{
	private $animalsCollection;

	public function addAnimal()
	{
		$this->animalsCollection[] = $animal;
	}

	public function watch()
	{
		foreach ($this->animalsCollection as $animal) {
			if ($animal instanceof Animal) {
				$animal->breach();
				$animal->eat();
				$animal->sleep();
			}
			echo '<br/><br/>';
		}
	}

	public function kill()
	{
		echo '我想要吃点新鲜的。。哈哈';
		$count = count($this->animalsCollection);
		$random = mt_rand(0, $count - 1);
		$animalWillBeDied = $this->animalsCollection[$random];
		echo $animalWillBeDied->name . '将要被痛宰做成好吃的';
		$animalWillBeDied->scream();
		echo '我是真的想吃点新鲜的。。哈哈';
	}
}